package com.onepower.core.result;


import lombok.Data;

import java.io.Serializable;

/**
 * @author kin
 * @since 2017/12/19
 */
public class CommonResult implements Serializable {

    private static final long serialVersionUID = 7070149896025566800L;
    /**
     * 返回code
     */
    private int code;

    /**
     * 结果描述
     **/
    private String message;

    /**
     * 返回结果
     */
    private Object data;

    public CommonResult() {
        this.code = BaseResultCode.SUCCESS.getCode();
        this.message = BaseResultCode.SUCCESS.getMsg();
    }

    public CommonResult(ResultCode resultCode) {
        this.code = resultCode.getCode();
        this.message = resultCode.getMsg();
    }


    public CommonResult(int bizCode, String bizMsg) {
        this.code = bizCode;
        this.message = bizMsg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
